import request from './request.js'

const article = {
	//发布文章
	addArticle(data) {
		return request.post('/user/addArticle', data)
	},
	updataArticle(data) {
		return request.post('/user/updataArticle', data)
	},
	delArticle(data) {
		return request.post('/user/delArticle', data)
	},
	upload(data) {
		console.log(data)
		return request.post('/upload', data,{
			header: {
				"Content-Type": "multipart/form-data"
			}
		})
	},
	//获取榜单
	getArticleListHot(data) {
		return request.post('/user/getArticleListHot', data)
	},
	//获取关注列表文章
	getFollowArticleList(data) {
		return request.post('/user/getFollowArticleList', data)
	},
	//点赞(点赞人likerid，artileid文章id)
	giveLike(data) {
		return request.post('/user/giveLike', data)
	},
	
	/* 评论 */
	//根据文章id获取评论
	getCommentListId(data) {
		return request.post('/user/getCommentListId', data)
	},
	//根据用户id和文章id生成评论 createtime
	createCommentInfo(data) {
		return request.post('/user/createCommentInfo', data)
	},
	//根据用户id、文章id、评论id 删除评论
	delCommentListId(data) {
		return request.post('/user/delCommentListId', data)
	},
	/* 词条 */
	//获取词条列表
	getEntryList(data) {
		return request.post('/news/getEntryList', data)
	},
	createEntry(data) {
		return request.post('/news/createEntry', data)
	}
}
export default article
